<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button onclick="restore()">点我</button>
    <script>
        var nums = [1,5,4,4,7,6,6] 
        var nums2=[];
        function restore(){
            for(var i=0;i<nums.length;i++){
                nums2.push(nums[i]);
                for(var j=i+1;j<nums.length;j++ ){
                    if(nums[i] == nums[j]){
                        nums2.pop();
                    }
                }
            }
            for(var i=0;i<nums2.length;i++){
                document.write(nums2[i]);
            }
            
        }
    </script>
</body>
</html>